using WowPacketParser.Misc;

namespace WowPacketParser.Enums.Version.V4_3_3_15354
{
    public static class Opcodes_4_3_3
    {
        public static BiDictionary<Opcode, int> Opcodes(Direction direction)
        {
            switch (direction)
            {
                case Direction.ClientToServer:
                case Direction.BNClientToServer:
                    return ClientOpcodes;
                case Direction.ServerToClient:
                case Direction.BNServerToClient:
                    return ServerOpcodes;
                default:
                    return MiscOpcodes;
            }
        }

        private static readonly BiDictionary<Opcode, int> ClientOpcodes = new BiDictionary<Opcode, int>
        {
            {Opcode.CMSG_ADDON_REGISTERED_PREFIXES, 0x0480},
            {Opcode.CMSG_AREA_TRIGGER, 0x33A4},
            {Opcode.CMSG_AUTH_CONTINUED_SESSION,0x0A26},
            {Opcode.CMSG_AUTH_SESSION, 0x0A02},
            {Opcode.CMSG_BATTLEFIELD_STATUS, 0x2701},
            {Opcode.CMSG_ENUM_CHARACTERS, 0x2161},
            {Opcode.CMSG_QUERY_CREATURE, 0x23ED},
            {Opcode.CMSG_QUERY_GAME_OBJECT, 0x6B65},
            {Opcode.CMSG_GAME_OBJ_USE, 0x7B64},
            {Opcode.CMSG_GET_ITEM_PURCHASE_DATA, 0x6FE4},
            {Opcode.CMSG_GOSSIP_HELLO, 0x65AC},
            {Opcode.CMSG_GOSSIP_SELECT_OPTION, 0x2724},
            {Opcode.CMSG_GUILD_BANK_LOG_QUERY, 0x0218},
            {Opcode.CMSG_GUILD_BANK_REMAINING_WITHDRAW_MONEY_QUERY, 0x0290},
            {Opcode.CMSG_GUILD_BANK_QUERY_TAB, 0x6F2D},
            {Opcode.CMSG_GUILD_BANK_TEXT_QUERY, 0x0230},
            {Opcode.CMSG_GUILD_GET_RANKS, 0x0255},
            {Opcode.CMSG_GUILD_GET_ROSTER, 0x0274},
            {Opcode.CMSG_REQUEST_GUILD_PARTY_STATE, 0x1390},
            {Opcode.CMSG_GUILD_SET_ACHIEVEMENT_TRACKING, 0x02D1},
            {Opcode.CMSG_CHAT_JOIN_CHANNEL, 0x0520},
            {Opcode.CMSG_CHAT_LEAVE_CHANNEL, 0x0000},
            {Opcode.CMSG_LF_GUILD_ADD_RECRUIT, 0x0004},
            {Opcode.CMSG_LOADING_SCREEN_NOTIFY, 0x3101},
            {Opcode.CMSG_CHAT_ADDON_MESSAGE_GUILD, 0x0528},
            {Opcode.CMSG_MOVE_FALL_RESET, 0x12D0},
            {Opcode.CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK, 0x1250},
            {Opcode.CMSG_MOVE_NOT_ACTIVE_MOVER, 0x1775},
            {Opcode.CMSG_MOVE_SET_CAN_FLY_ACK, 0x13F1},
            {Opcode.CMSG_MOVE_SET_FLY, 0x1BB4},
            {Opcode.CMSG_QUERY_NPC_TEXT, 0x7CA5},
            {Opcode.CMSG_PING, 0x0226},
            {Opcode.CMSG_REQUEST_PLAYED_TIME, 0x68E5},
            {Opcode.CMSG_PLAYER_LOGIN, 0x3320},
            {Opcode.CMSG_QUERY_BATTLEFIELD_STATE, 0x1611},
            {Opcode.CMSG_QUERY_TIME, 0x3625},
            {Opcode.CMSG_QUEST_GIVER_ACCEPT_QUEST, 0x3065},
            {Opcode.CMSG_QUEST_GIVER_CHOOSE_REWARD, 0x2BAD},
            {Opcode.CMSG_QUEST_GIVER_COMPLETE_QUEST, 0x796D},
            {Opcode.CMSG_QUEST_GIVER_QUERY_QUEST, 0x7AED},
            {Opcode.CMSG_QUEST_GIVER_STATUS_MULTIPLE_QUERY, 0x77E4},
            {Opcode.CMSG_QUEST_GIVER_STATUS_QUERY, 0x6024},
            {Opcode.CMSG_QUEST_LOG_REMOVE_QUEST, 0x7665},
            {Opcode.CMSG_READY_FOR_ACCOUNT_DATA_TIMES, 0x2924},
            {Opcode.CMSG_REALM_SPLIT, 0x66AD},
            {Opcode.CMSG_REQUEST_ACCOUNT_DATA, 0x29A4},
            {Opcode.CMSG_REQUEST_PET_INFO, 0x3EAC},
            {Opcode.CMSG_REQUEST_RAID_INFO, 0x60ED},
            {Opcode.CMSG_RESET_FACTION_CHEAT, 0x0222},
            {Opcode.CMSG_SELL_ITEM, 0x2B25},
            {Opcode.CMSG_SET_ACTION_BAR_TOGGLES, 0x74A5},
            {Opcode.CMSG_SET_SELECTION, 0x2325},
            {Opcode.CMSG_SET_SHEATHED, 0x2AED},
            {Opcode.CMSG_SET_VEHICLE_REC_ID_ACK, 0x1310},
            {Opcode.CMSG_SUSPEND_TOKEN_RESPONSE, 0x0A06},
            {Opcode.CMSG_TAXI_NODE_STATUS_QUERY, 0x7E65},
            {Opcode.CMSG_UI_TIME_REQUEST, 0x39E5},
            {Opcode.CMSG_CHAT_UNREGISTER_ALL_ADDON_PREFIXES, 0x0028},
            {Opcode.CMSG_UPDATE_ACCOUNT_DATA, 0x38EC},
            {Opcode.CMSG_USE_ITEM, 0x352D},
            {Opcode.CMSG_WARDEN_DATA, 0x0202},
            {Opcode.CMSG_ZONEUPDATE, 0x3125}
        };

        private static readonly BiDictionary<Opcode, int> ServerOpcodes = new BiDictionary<Opcode, int>
        {
            {Opcode.SMSG_ACCOUNT_DATA_TIMES, 0x622D},
            {Opcode.SMSG_ADDON_INFO, 0x22AD},
            {Opcode.SMSG_ALL_ACHIEVEMENT_DATA, 0x390E},
            {Opcode.SMSG_ATTACKER_STATE_UPDATE, 0x306D},
            {Opcode.SMSG_AURA_UPDATE, 0x3A24},
            {Opcode.SMSG_AURA_UPDATE_ALL, 0x7A25},
            {Opcode.SMSG_AUTH_CHALLENGE, 0x0055},
            {Opcode.SMSG_AUTH_RESPONSE, 0x3C84},
            {Opcode.SMSG_BIND_POINT_UPDATE, 0x696D},
            {Opcode.SMSG_CALENDAR_SEND_CALENDAR, 0x2125},
            {Opcode.SMSG_CHANNEL_NOTIFY, 0x322D},
            {Opcode.SMSG_CHAT, 0x2FEC},
            {Opcode.SMSG_ENUM_CHARACTERS_RESULT, 0x30C6},
            {Opcode.SMSG_CACHE_VERSION, 0x306C},
            {Opcode.SMSG_CONTACT_LIST, 0x2D65},
            {Opcode.SMSG_CORPSE_RECLAIM_DELAY, 0x79EC},
            {Opcode.SMSG_QUERY_CREATURE_RESPONSE, 0x6424},
            {Opcode.SMSG_DB_REPLY, 0x2546},
            {Opcode.SMSG_DESTROY_OBJECT, 0x3324},
            {Opcode.SMSG_EMOTE, 0x2525},
            {Opcode.SMSG_FEATURE_SYSTEM_STATUS, 0x7D06},
            {Opcode.SMSG_QUERY_GAME_OBJECT_RESPONSE, 0x64AC},
            {Opcode.SMSG_GOSSIP_COMPLETE, 0x21AC},
            {Opcode.SMSG_GOSSIP_MESSAGE, 0x7664},
            {Opcode.SMSG_GUILD_EVENT, 0x632D},
            {Opcode.SMSG_QUERY_GUILD_INFO_RESPONSE, 0x2BEC},
            {Opcode.SMSG_GUILD_RANKS, 0x6D06},
            {Opcode.SMSG_GUILD_ROSTER, 0x350C},
            {Opcode.SMSG_INITIALIZE_FACTIONS, 0x3865},
            {Opcode.SMSG_SEND_KNOWN_SPELLS, 0x7364},
            {Opcode.SMSG_INIT_WORLD_STATES, 0x272C},
            {Opcode.SMSG_INSTANCE_DIFFICULTY, 0x1755},
            {Opcode.SMSG_LEARNED_DANCE_MOVES, 0x2CEC},
            {Opcode.SMSG_LOAD_EQUIPMENT_SET, 0x6AED},
            {Opcode.SMSG_LOGIN_SET_TIME_SPEED, 0x6B2D},
            {Opcode.SMSG_LOGIN_VERIFY_WORLD, 0x3EE5},
            {Opcode.SMSG_MOTD, 0x3C6D},
            {Opcode.SMSG_MOVE_SET_CAN_FLY, 0x64CE},
            {Opcode.SMSG_QUERY_PLAYER_NAME_RESPONSE, 0x7865},
            {Opcode.SMSG_QUERY_NPC_TEXT_RESPONSE, 0x646C},
            {Opcode.SMSG_ON_MONSTER_MOVE, 0x29A5},
            {Opcode.SMSG_QUERY_PET_NAME_RESPONSE, 0x2865},
            {Opcode.SMSG_PLAYER_VEHICLE_DATA, 0x27E5},
            {Opcode.SMSG_PONG, 0x0085},
            //{Opcode.SMSG_PONG, 0x0302},
            {Opcode.SMSG_QUEST_GIVER_OFFER_REWARD_MESSAGE, 0x7EAC},
            {Opcode.SMSG_QUEST_GIVER_QUEST_DETAILS, 0x23E5},
            {Opcode.SMSG_QUEST_GIVER_REQUEST_ITEMS, 0x32AD},
            {Opcode.SMSG_QUERY_QUEST_INFO_RESPONSE, 0x2AAD},
            {Opcode.SMSG_REALM_SPLIT, 0x7444},
            {Opcode.SMSG_CONNECT_TO, 0x0855},
            {Opcode.SMSG_RESUME_COMMS, 0x0015},
            {Opcode.SMSG_SEND_UNLEARN_SPELLS, 0x78AC},
            {Opcode.SMSG_PHASE_SHIFT_CHANGE, 0x7104},
            {Opcode.SMSG_SET_PROFICIENCY, 0x7324},
            {Opcode.SMSG_SPELL_GO, 0x6425},
            {Opcode.SMSG_SPELL_START, 0x212D},
            {Opcode.SMSG_UPDATE_ACTION_BUTTONS, 0x604C},
            {Opcode.SMSG_UPDATE_TALENT_DATA, 0x7FA5},
            {Opcode.SMSG_TIME_SYNC_REQUEST, 0x650E},
            {Opcode.SMSG_TUTORIAL_FLAGS, 0x25A4},
            {Opcode.SMSG_UPDATE_ACCOUNT_DATA,0x7565},
            {Opcode.SMSG_UPDATE_OBJECT, 0x6264},
            {Opcode.SMSG_UPDATE_WORLD_STATE, 0x60A5}
        };

        private static readonly BiDictionary<Opcode, int> MiscOpcodes = new BiDictionary<Opcode, int>
        {
            {Opcode.MSG_GUILD_PERMISSIONS, 0x02BC},
            {Opcode.MSG_MOVE_HEARTBEAT,0x1FF4},
            {Opcode.MSG_MOVE_JUMP, 0x1A10},
            {Opcode.MSG_MOVE_SET_FACING, 0x16B4},
            {Opcode.MSG_MOVE_SET_FLIGHT_SPEED, 0x71C6},
            {Opcode.MSG_MOVE_SET_PITCH, 0x1251},
            {Opcode.MSG_MOVE_SET_RUN_MODE, 0x13F4},
            {Opcode.MSG_MOVE_SET_RUN_SPEED, 0x7004},
            {Opcode.MSG_MOVE_SET_SWIM_BACK_SPEED, 0x3404},
            {Opcode.MSG_MOVE_SET_SWIM_SPEED, 0x70CC},
            {Opcode.MSG_MOVE_SET_WALK_MODE, 0x1B71},
            {Opcode.MSG_MOVE_SET_WALK_SPEED, 0x704C},
            {Opcode.MSG_MOVE_START_ASCEND, 0x17F4},
            {Opcode.MSG_MOVE_START_BACKWARD, 0x1A91},
            {Opcode.MSG_MOVE_START_DESCEND, 0x1355},
            {Opcode.MSG_MOVE_START_FORWARD, 0x1E74},
            {Opcode.MSG_MOVE_START_PITCH_DOWN, 0x1E70},
            {Opcode.MSG_MOVE_START_PITCH_UP, 0x1370},
            {Opcode.MSG_MOVE_START_STRAFE_LEFT, 0x1E51},
            {Opcode.MSG_MOVE_START_STRAFE_RIGHT, 0x1691},
            {Opcode.MSG_MOVE_START_SWIM, 0x1A90},
            {Opcode.MSG_MOVE_START_TURN_LEFT, 0x1B11},
            {Opcode.MSG_MOVE_START_TURN_RIGHT, 0x1AD4},
            {Opcode.MSG_MOVE_STOP, 0x1350},
            {Opcode.MSG_MOVE_STOP_ASCEND, 0x1690},
            {Opcode.MSG_MOVE_STOP_PITCH, 0x1E15},
            {Opcode.MSG_MOVE_STOP_STRAFE, 0x1631},
            {Opcode.MSG_MOVE_STOP_SWIM, 0x1E11},
            {Opcode.MSG_MOVE_STOP_TURN, 0x1331},
            {Opcode.MSG_MOVE_TOGGLE_COLLISION_CHEAT, 0x1AF0},
            {Opcode.MSG_SET_DUNGEON_DIFFICULTY, 0x22ED}
        };
    }
}
